package org.example.shop.order.service.impl;

import org.example.shop.entity.Order;
import org.example.shop.order.dao.OrderDao;
import org.example.shop.order.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderDao orderDao;

    public Order findByOid(Integer oid) {
        return orderDao.findById(oid).get();
    }

    @Override
    public Order save(Order order) {
        return orderDao.saveAndFlush(order);
    }
}
